//2009/08/19 22:02:43
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class NounReform
{
public:
    vector <string> makePlural(vector <string> nouns)
    {
		vector<string> ret;
		for(int i=0; i<nouns.size(); i++)
		{
			string end = "";
			char ch = nouns[i][nouns[i].size() - 1];
			if(nouns[i].size() > 1)
				end += nouns[i].substr(nouns[i].size()-2);
			if(ch=='s' ||ch=='z'||ch=='x'|| end =="ch" || end=="sh")
			{
				string temp = nouns[i] + "es";
				ret.push_back(temp);
			}
			else if(end=="ay"||end=="ey"||end=="iy"||end=="oy"||end=="uy")
			{
				string temp = nouns[i] + "s";
				ret.push_back(temp);
			}
			else if(ch == 'y')
			{
				string temp = nouns[i].substr(0, nouns[i].size()-1);
				temp += "ies";
				ret.push_back(temp);
			}
			else
			{
				string temp = nouns[i] + "s";
				ret.push_back(temp);
			}	
		}
		return ret;
    }
};
